<?php

use PhpAmqpLib\Connection\AMQPStreamConnection;

require_once __DIR__ . '/../../vendor/autoload.php';

$connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest');
$channel = $connection->channel();
$channel->queue_declare('simple', false, false, false, false);
$callback = function ($msg) {
	  echo $msg->body, PHP_EOL;
};
$channel->basic_consume('simple', '', false, true, false, false, $callback);
while ($channel->is_open()) {
	$channel->wait();
}
$channel->close();
$connection->close();
